/*
 * @Author: chengjiang
 * @Date: 2023-10-31 18:05:28
 * @Description: 
 */
import request from '@/utils/request'

//使用封装好的request
export function getInfo(params: Object) {
  return request({
    url: '/user/info',
    method: 'get',
    params
  })
}

//返回所有的res信息
export function login(data: Object) {
  return request({
    url: '/user/login',
    method: 'post',
    data,
    meta: {
      responseAll: true // 返回所有的信息，包括状态码和message和data
    }
  } as any)
}

//使用repeatRequest参数让接口 可以同一时间多次调用
export function getList(params: Object) {
  return request({
    url: '/message/list',
    method: 'get',
    params,
    repeatRequest: true // 配置为true，则可以同一时间多次调用
  }as any)
}

//使用loading
export function getListById(loading: Object) {
  return request({
    url: '/message/listbyId',
    method: 'get',
    ...loading
  })
}

export function gettableList() {
  return request({
    url: '/user/tableData',
    method: 'get'
  })
}

// 图片上传

export interface Photo {
  id?: number,
  priceType: number, // 0: 看价盘，1: customer临售盘
  type: number, // 0: logo, 1: qrcode, 2: wxcode,  // 4: customer_photo.
  content: string,
}

export interface GetPhotoReq {
  type?: number,
  priceType: number,
}

export function GetPhoto(data: GetPhotoReq) {
  return request<Array<Photo>>({
    url: '/back/open-api/basic/setting/resource/config/list/1',
    method: 'post',
    data,
    meta: {
      responseAll: true // 返回所有的信息，包括状态码和message和data
    }
  } as any)
}